#include "SnapshotManager.h"
//#include "densityField.h"
#include "ParticleSys.h"


DecoSnapshotManager* DecoSnapshotManager::msSnapshotManager = NULL;

DecoSnapshotManager* DecoSnapshotManager::GetSingleton()
{
	if (!msSnapshotManager)
		msSnapshotManager = new DecoSnapshotManager();
	return msSnapshotManager;
}

void DecoSnapshotManager::DestroySingleton()
{
	if (msSnapshotManager)
		delete msSnapshotManager;
}

void DecoSnapshotManager::SnapshotToFile(string fileName, DecoScene* scene)
{
	DecoArchive Ar(fileName, AT_Write);
	scene->Serialize(Ar);
}
void DecoSnapshotManager::RecoverFromSnapshot(string fileName, DecoScene* scene)
{
	DecoArchive Ar(fileName, AT_Read);
	scene->Deserialize(Ar);
}